package org.zhong.orderservice.Controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.core.annotation.Order;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.zhong.orderservice.feignClient.PointServiceFeignClient;

@RestController
@RequestMapping(value = "/order")
@RefreshScope   //nacos动态刷新  修改nacos，项目不用在重启
public class OrderController {

    @Autowired
    private PointServiceFeignClient pointServiceFeignClient;

    @GetMapping(value = "/test")
    public String test (){
        return "this is order-service";
    }

    @GetMapping(value = "/test/getConfigInfo")
    public String getConfigInfo (){
        int c=245;
        int b=2456;
        return  "this is order-service getConfigInfo";
    }

    @PostMapping(value = "/add")
    public String addOrder(){
        String s = pointServiceFeignClient.addPoint2("傻11逼");
        return s;
    }

}
